importLibrary(url) Method |
This method imports a library to an application. All functions of the imported library are available on the application window.
Syntax
application.importlibrary(url)
Parameters
Parameter |
Description |
---|---|
url |
Required. Denotes the url of the library to be imported to the application. |
Return Value
No return value.
Remarks
To import a library, the object of the library needs to be made public using the setPublic() method. The setPublic() method accepts a single parameter which is the library object.
Once made public and imported to other libraries and web applications, the object can be used in the current context with properties and methods.
Example
The following example shows how an object is made public using the setPublic() method in a library.
<HTML> <HEAD> <SCRIPT> setPublic(Order); function Order() { } function Order.prototype.getOrderId() { return this.id; } function Order.prototype.setOrderId(id) { this.id = id; } </SCRIPT> </HEAD> <BODY/> </HTML>